<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class H_Keyword extends H_B{
    protected $_primary = 'keyword';
    public function __construct() {
        parent::__construct();
        $dbconfig = $this->_db->getConfig();
        $this->_name = $dbconfig['prefix'].'keyword';
    }

    public function edit($keyword,$data){
        $this->filterData($data);
        $where = $this->_db->quoteInto("keyword = ?", $keyword);
        return $this->update($data, $where);
    }

    public function del($keyword){
        $where = $this->_db->quoteInto("keyword = ?", $keyword);
        return $this->delete($where);
    }

    public function getKeyByControllerAndAction($controller,$action){
        $select = $this->_db->select();
        $select->from($this->_name)
                ->where('thecontroller like ?', "%".$controller."%")
                ->where('theaction like ?', "%".$action."%");
        return $this->_db->fetchAll($select,null,Zend_Db::FETCH_ASSOC);
    }
}
?>
